package com.base.caselib;

import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.amap.api.location.AMapLocation;
import com.arvin.imagepicker.widget.ImagePickView;
import com.base.caselib.bean.CaseBean;
import com.base.caselib.bean.CaseToAdvanceBean;
import com.base.caselib.bean.CaseType;
import com.base.caselib.bean.CheckBoxBean;
import com.base.caselib.bean.DropBean;
import com.base.caselib.databinding.ActivityCaseBinding;
import com.base.caselib.presenter.CasePresenter;
import com.base.caselib.view.Case2View;
import com.base.caselib.view.CaseView;
import com.base.caselib.widget.CheckBoxCustom;
import com.base.caselib.widget.CheckMultipleDropCustom;
import com.base.caselib.widget.DateCustom;
import com.base.caselib.widget.EditNumCustom;
import com.base.caselib.widget.EditTextCustom;
import com.base.caselib.widget.SingleCheckCustom;
import com.base.caselib.widget.SpinnerCustom;
import com.base.caselib.widget.TitleCustom;
import com.base.commonlib.base.CBaseBarMvpActivity;
import com.base.commonlib.event.AddressEvent;
import com.base.commonlib.event.WebTestEvent;
import com.base.commonlib.http.RealNetWorkUtil;
import com.base.commonlib.utils.RxBus2;
import com.base.commonlib.utils.ToastUtil;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;

/**
 * Created by weikailiang on 2019/10/12.
 */
@Route(path = "/case/case2add")
public class Case2Activity extends CBaseBarMvpActivity<Case2Presenter> implements Case2View {
    //案件流程
    ArrayList<CaseType> mListCastType = null;
    List<LinearLayout> mLayout = new ArrayList<>();
    private ActivityCaseBinding mBinding;
    private String CaseId = "";
    private String mNextStateValue = "";

    CaseToAdvanceBean mCaseAdvanceBean = null;
    @Autowired
    String ID;
    @Autowired
    int num;
    @Autowired
    String type;//1 一般案件 2 简易案件 3 暂扣物品 4 先行登记 5教育纠处
    @Autowired
    String caseId;
    @Autowired
    boolean isCase;
    @Autowired
    String isSimulate;

    private List<EditTextCustom> mAddressCustom = new ArrayList<>();
    @Override
    protected int getLayoutResource() {
        return R.layout.activity_case;
    }

    @Override
    protected void init() {
        super.init();
        mBinding = (ActivityCaseBinding) mRootBinding;
        setBackNavigationTip(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mWaringDialog.show();
            }
        });
        mPresenter = new Case2Presenter(this,this);
        mPresenter.ID = ID;
        mPresenter.isSimple = num;
        mPresenter.start();
        if (isCase){
            mPresenter.isCase = false;
        }
        if (!TextUtils.isEmpty(caseId)){
            CaseId = caseId;
        }
        if (!TextUtils.isEmpty(isSimulate)){
            mPresenter.isSimulate = isSimulate;
        }
        if (type.equals("1")){
            setRigImg(R.drawable.ic_add, new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    //先行登记
                    if (TextUtils.isEmpty(CaseId)){
                        showMes("请先保存");
                        return;
                    }
                    ARouter.getInstance().build("/case/case2add")
                            .withString("ID","h5LAtzdrlJUG17azQsh")
                            .withInt("num",1)
                            .withString("type","4")
                            .withString("caseId",CaseId)
                            .withSerializable("caseadvance",mPresenter.mCaseToAdvance)
                            .navigation();
                }
            });
        }
        if (type.equals("4")){
            if (!TextUtils.isEmpty(CaseId)){
                mCaseAdvanceBean = (CaseToAdvanceBean) getIntent().getSerializableExtra("caseadvance");
            }
        }
//        if (type.equals("3")||type.equals("4")){
//            mBinding.btnCase.setVisibility(View.VISIBLE);
//        }

    }

    @Override
    protected void start() {
        mBinding.btnCase.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //转入案件
                if (type.equals("3")||type.equals("4")){
                   if (TextUtils.isEmpty(CaseId)){
                       showMes("请先保存");
                       return;
                   }
                    mPresenter.changeInto();
                }
            }
        });
        mBinding.save.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mPresenter.save(mLayout);
            }
        });
        mBinding.saveDetail.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                for (CaseBean.ModulesBean bean : mPresenter.mCaseBean.getModules()){
                    if (bean.getModuleTitle().equals("隐藏信息")){
                        for (CaseBean.ModulesBean.RowsBean mRow : bean.getRows()){
                            if (mRow.getFieldSave().equals("next_case_status")){
                                mNextStateValue = mRow.getFixValue();
                            }
                        }
                    }
                }
                ARouter.getInstance().build("/pretrial/pret")
                        .withString("mFormId",mPresenter.mCaseBean.getId())
                        .withString("CaseId",CaseId)
                        .withString("tbFlag",mPresenter.mCaseBean.getFormMainValue())
                        .withString("content",mPresenter.mCaseBean.getFormTitle())
                        .withString("nextCaseStatus",mNextStateValue)
                        .withParcelableArrayList("casetype",mListCastType)
                        .withString("mCaseAbstract",mPresenter.mCaseAbstract)
                        .navigation();
            }
        });
        mBinding.update.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //更新
                mPresenter.updataCase(mLayout);
            }
        });
        mBinding.apply.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (mListCastType == null){
                    //没有流程
                    showMes("未获取到流程");
                    return;
                }
                if (type.equals("3")){
                    mPresenter.BindCase(mListCastType.get(0).getId(),CaseId,mPresenter.mCaseBean.getId(),mPresenter.mCaseBean.getFormMainValue(),mPresenter.mCaseBean.getFormTitle(),mNextStateValue);
                }else if (type.equals("4")){
                    if (mListCastType==null){
                        showMes("流程ID为空");
                        return;
                    }
                    mPresenter.BindCase(mListCastType.get(0).getId(),CaseId,mPresenter.mCaseBean.getId(),mPresenter.mCaseBean.getFormMainValue(),mPresenter.mCaseBean.getFormTitle(),mNextStateValue);
                }
            }
        });
        Disposable disposable = RxBus2.getInstance().doSubscribe(AddressEvent.class, new Consumer<AddressEvent>() {
            @Override
            public void accept(AddressEvent randomRefreshEvent) throws Exception {
                if (mAddressCustom.size()>0){
                    for (EditTextCustom custom : mAddressCustom){
                        if (custom.getFileSave().equals("occurred_address")||custom.getFileSave().equals("investigate_location")) {
                            if (type.equals("4")){
                                if (mCaseAdvanceBean!=null){

                                }else {
                                    custom.setmEtText(randomRefreshEvent.getAddress());
                                }
                            }else {
                                custom.setmEtText(randomRefreshEvent.getAddress());
                            }
                        }
                    }
                }
            }
        });
        RxBus2.getInstance().addSubscription(this, disposable);
        mBinding.print.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (type.equals("4")){
                    //先行登记打印
                    if (RealNetWorkUtil.TYPE.equals("1")) {
                        mPresenter.Printwithold(CaseId);
                    }else if (RealNetWorkUtil.TYPE.equals("0")) {
                        mPresenter.getPdfUrlAddress(CaseId,"advanceregistration");
                    }
                }else if (type.equals("3")){
                    if (RealNetWorkUtil.TYPE.equals("1")) {
                        mPresenter.Printwithold(CaseId);
                    }else if (RealNetWorkUtil.TYPE.equals("0")) {
                        mPresenter.getPdfUrlAddress(CaseId,"advanceregistration");
                    }
                }else if (type.equals("2")){
                    mPresenter.getPrintEaseCase(CaseId);
                }
            }
        });
    }


    private List<View> getAllChildViews(View view) {
        List<View> allchildren = new ArrayList<View>();
        if (view instanceof ViewGroup) {
            ViewGroup vp = (ViewGroup) view;
            for (int i = 0; i < vp.getChildCount(); i++) {
                View viewchild = vp.getChildAt(i);
                allchildren.add(viewchild);
                //再次 调用本身（递归）
                allchildren.addAll(getAllChildViews(viewchild));
            }
        }
        return allchildren;
    }




    @Override
    public void returnCaseBean(CaseBean bean) {
        mPresenter.setmCaseBean(bean);
        setBarTitle(bean.getFormTitle());
        for (CaseBean.ModulesBean models : bean.getModules()){
            createModels(models);
        }




    }

    @Override
    public void saveSuccess(String Id) {
        ToastUtil.show("上报成功");
        if (type.equals("5")){
            mBinding.saveDetail.setVisibility(View.GONE);
            mBinding.save.setVisibility(View.GONE);
            mBinding.update.setVisibility(View.GONE);
            RxBus2.getInstance().post(new WebTestEvent("getOwnExaminationPaper"));
            finish();
        }else if (type.equals("3")||type.equals("4")){
            if (RealNetWorkUtil.TYPE.equals("1")){
                mBinding.apply.setVisibility(View.GONE);
            }else if (RealNetWorkUtil.TYPE.equals("0")){
                mBinding.apply.setVisibility(View.VISIBLE);
            }
            //请求操作步骤
            mPresenter.getInfoByProType();
        }
        CaseId = Id;
        if (mPresenter.isSimple == 2) {
            mBinding.saveDetail.setVisibility(View.VISIBLE);
            mBinding.update.setVisibility(View.VISIBLE);
            mBinding.save.setVisibility(View.GONE);
            //请求操作步骤
            mPresenter.getInfoByProType();
        }else if (mPresenter.isSimple ==1){
            mBinding.saveDetail.setVisibility(View.GONE);
            mBinding.save.setVisibility(View.GONE);
            mBinding.update.setVisibility(View.GONE);
            mBinding.print.setVisibility(View.VISIBLE);
        }else {
            mBinding.saveDetail.setVisibility(View.GONE);
            mBinding.save.setVisibility(View.GONE);
            mBinding.update.setVisibility(View.GONE);
        }
    }

    @Override
    public void returnCaseTypeList(List<CaseType> mCaseType) {
        mListCastType = (ArrayList<CaseType>) mCaseType;
    }

    @Override
    public String getCaseid() {
        return CaseId;
    }

    @Override
    public void returnNotice(String notice) {

    }

    @Override
    public String returnType() {
        return type;
    }

    @Override
    public void returnLocation(AMapLocation aMapLocation) {
        if (mAddressCustom.size()>0){
            for (EditTextCustom custom : mAddressCustom){
                if (custom.getFileSave().equals("occurred_address")||custom.getFileSave().equals("investigate_location")) {
                    if (type.equals("4")&&mCaseAdvanceBean!=null){
                    }else {
                        custom.setmEtText(aMapLocation.getAddress());
                    }
                }
            }
        }
    }

    @Override
    public void returnApplySuccess() {
        mBinding.apply.setVisibility(View.GONE);
    }

    @Override
    public void notifyDateCase(String modeIndex) {
        //获取模块索引
        if (mLayout != null&&mLayout.size()>0){
            for (LinearLayout view : mLayout) {
                if (view != null) {
                    if (view.getTag() != null) {
                        if (view.getTag().toString().equals(modeIndex)) {
                            //获取到该模块
                            List<View> views = getAllChildViews(view);
                            for (View view1 :views){
                                if (view1 instanceof SpinnerCustom){
                                    SpinnerCustom custom1 = (SpinnerCustom) view1;
                                    custom1.notifyDataCase();
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    private void createModels(CaseBean.ModulesBean models){
        mPresenter.startLocationForLl();
        //创建模块
        final TitleCustom titleCustom = new TitleCustom(mContext);
        titleCustom.setmTvName(models.getModuleTitle());
        final LinearLayout mLinearLayout=new LinearLayout(this);
        mLinearLayout.setOrientation(LinearLayout.VERTICAL);
        mLinearLayout.setTag(models.getModuleIndex());
        mLinearLayout.addView(titleCustom);
        mBinding.root.addView(mLinearLayout);

        final LinearLayout chilLayout=new LinearLayout(this);
        chilLayout.setOrientation(LinearLayout.VERTICAL);
        mLinearLayout.addView(chilLayout);
        //模块显示隐藏
        titleCustom.setTxImgResource(R.drawable.ic_shouqi);
        titleCustom.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (chilLayout.getVisibility() == View.VISIBLE){
                    chilLayout.setVisibility(View.GONE);
                    titleCustom.setTxImgResource(R.drawable.ic_xiala);
                }else {
                    chilLayout.setVisibility(View.VISIBLE);
                    titleCustom.setTxImgResource(R.drawable.ic_shouqi);
                }
            }
        });
        mLayout.add(mLinearLayout);
        for (CaseBean.ModulesBean.RowsBean row : models.getRows()){
            if (row.getFieldSave().equals("case_cause_number")){
                //权力编码 特殊处理
                mPresenter.mPowerCoding = row;
            }
            if (models.getIsHide()==1){
                mLinearLayout.setVisibility(View.GONE);
            }
            createRow(row,chilLayout,models.getModuleIndex()+"",models);
        }
    }
    //创建行
    private void createRow(final CaseBean.ModulesBean.RowsBean row, final LinearLayout layout, final String mIndex, final CaseBean.ModulesBean modulesBean){

        if (row.getConType().equals("string")){
            EditTextCustom custom = null;
            if (row.getIsDefault()==1){
                custom = new EditTextCustom(mContext, 0);
                if (type.equals("4")){
                    if (mCaseAdvanceBean !=null){
                        if (row.getFieldSave().equals("litigant_citizen_name")){
                            custom.setmEtText(mCaseAdvanceBean.getmParty());
                        }
                    }
                }else {
                    custom.setmEtText(row.getFixValue());
                }
            }else {
                if (row.getFieldSave().equals("occurred_address")||row.getFieldSave().equals("investigate_location")) {
                    if (type.equals("4")){
                        if (mCaseAdvanceBean !=null){
                            custom = new EditTextCustom(mContext, 1);
                            custom.setmEtText(mCaseAdvanceBean.getmAddress());
                            mAddressCustom.add(custom);
                        }else {
                            custom = new EditTextCustom(mContext, 1);
                            mAddressCustom.add(custom);
                        }
                    }else {
                        custom = new EditTextCustom(mContext, 1);
                        mAddressCustom.add(custom);
                    }
                } else if (row.getFieldSave().equals("investigate_road") || row.getFieldSave().equals("occurred_road")) {
                    custom = new EditTextCustom(mContext, 2);
                    mAddressCustom.add(custom);
                } else {
                    custom = new EditTextCustom(mContext, 0);
                    if (type.equals("4")){
                        if (mCaseAdvanceBean !=null){
                            if (row.getFieldSave().equals("litigant_citizen_name")){
                                custom.setmEtText(mCaseAdvanceBean.getmParty());
                            }
                        }
                    }
                }
            }
            custom.setFileSave(row.getFieldSave());
            custom.setOnSpiner(mPresenter.mUser.getUserId());
            custom.setmTvName(row.getRowLabel());
            custom.setmRowIndex(row.getRowIndex()+"");
            custom.setTag(row.getRowIndex()+"");
            if (row.getIsRead()==1){
                custom.setReadLine(true);
            }else {
                custom.setmEtTextHint("请输入内容");
            }
            layout.addView(custom);
            if (row.getIsHide()==1){
                custom.setVisibility(View.GONE);
            }
        }else if(row.getConType().equals("int")){
            //数字输入框
            EditNumCustom custom = new EditNumCustom(mContext);
            custom.setmTvName(row.getRowLabel());
            custom.setmRowIndex(row.getRowIndex()+"");
            custom.setTag(row.getRowIndex()+"");
            custom.setmEtTextHint("请输入内容");
            if (row.getIsRead()==1){
                custom.setReadLine(true);
            }
            if (row.getIsDefault()==1){
                custom.setmEtText(row.getFixValue());
            }
            layout.addView(custom);
            if (row.getIsHide()==1){
                custom.setVisibility(View.GONE);
            }
        }else if (row.getConType().equals("date")){
            //date 日期输入框
            DateCustom custom = new DateCustom(mContext);
            custom.setmTvName(row.getRowLabel());
            custom.setmRowIndex(row.getRowIndex()+"");
            custom.setTag(row.getRowIndex()+"");
            custom.setY(true);
            if (row.getIsDefault()==1){
                custom.setmTvDates(row.getFixValue());
            }else {
                if (row.getIsNow() == 1) {
                    custom.setDefaultTime(true);
                } else {
                    custom.setmTvDate("日期输入框");
                }
            }
            layout.addView(custom);
            if (row.getIsHide()==1){
                custom.setVisibility(View.GONE);
            }
        }else if (row.getConType().equals("datetime")){
            //日期输入框 年月日时分秒
            DateCustom custom = new DateCustom(mContext);
            custom.setmTvName(row.getRowLabel());
            custom.setmRowIndex(row.getRowIndex()+"");
            custom.setTag(row.getRowIndex()+"");
            if (row.getIsDefault()==1){
                custom.setmTvDates(row.getFixValue());
            }else {
                if (row.getIsNow() == 1) {
                    custom.setDefaultTime(true);
                } else {
                    custom.setmTvDate("日期输入框 年月日时分秒");
                }
            }
            layout.addView(custom);
            if (row.getIsHide()==1){
                custom.setVisibility(View.GONE);
            }
        }else if (row.getConType().equals("text")){
            //大文本输入框
            EditTextCustom custom = null;
            if (row.getFieldSave().equals("occurred_address")){
                mAddressCustom.add(custom);
                custom = new EditTextCustom(mContext,1);
            }else {
                custom = new EditTextCustom(mContext,0);
            }
            custom.setOnSpiner(mPresenter.mUser.getUserId());
            custom.setmTvName(row.getRowLabel());
            custom.setTag(row.getRowIndex()+"");
            custom.setmEtTextHint("请输入内容");
            custom.setmRowIndex(row.getRowIndex()+"");
            if (row.getIsDefault()==1){
                custom.setmEtText(row.getFixValue());
            }
            layout.addView(custom);
            if (row.getIsHide()==1){
                custom.setVisibility(View.GONE);
            }
        }else if (row.getConType().equals("dropdown")){
            List<CheckBoxBean> checkBoxBeans = new Gson().fromJson(row.getFillValueOptions(),new TypeToken<List<CheckBoxBean>>(){}.getType());
            Map<String, String> stringStringMap = null;
            if (row.getConShowIndex() != "{}") {
                stringStringMap = new Gson().fromJson(row.getConShowIndex(), new TypeToken<Map<String, String>>() {
                }.getType());
            }


            //下拉选择框
            final SpinnerCustom custom = new SpinnerCustom(mContext);
            custom.setmRoadId(row.getRowId());
            custom.setTag(row.getRowIndex()+"");
            custom.setHintName("请选择");
            custom.setmName(row.getRowLabel());
            custom.setRow(row);
            if (type.equals("4")){
                if (mCaseAdvanceBean!=null){
                    if (row.getFieldSave().equals("case_type")){
                        custom.setDefault(true);
                        custom.setDefault(mCaseAdvanceBean.getmCaseType());
                    }else if (row.getFieldSave().equals("unlawful_act")){
                        custom.setDefault(true);
                        custom.setDefault(mCaseAdvanceBean.getmLlegal());
                    }else if (row.getFieldSave().equals("cause_number")){
                        custom.setDefault(true);
                        custom.setDefault(mCaseAdvanceBean.getmPowerCode());
                    }else if (row.getFieldSave().equals("applicable_case")){
                        custom.setDefault(true);
                        custom.setDefault(mCaseAdvanceBean.getmApplcableCase());
                    }else if (row.getFieldSave().equals("management_basis")){
                        custom.setDefault(true);
                        custom.setDefault(mCaseAdvanceBean.getmManagerBase());
                    }else if (row.getFieldSave().equals("legal_basis")){
                        custom.setDefault(true);
                        custom.setDefault(mCaseAdvanceBean.getmLegalRes());
                    }
                }
            }

            custom.setmRowIndex(row.getRowIndex()+"");
            custom.setCurrentModelIndex(mIndex);

            custom.setMapKeyValue(stringStringMap);

            if (checkBoxBeans!=null&&checkBoxBeans.size()>0) {
                custom.setData(checkBoxBeans);
            }
            mPresenter.mSpinnerCustom.add(custom);
            final CaseBean.ModulesBean createModel = (CaseBean.ModulesBean) modulesBean.clone();
            if (row.getFieldSave().equals("item_types")){
                View mView = getLayoutInflater().inflate(R.layout.item_add_delete,null);
                layout.addView(mView);
                mView.findViewById(R.id.add).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (createModel != null) {
                            int modexInde = new Random().nextInt(1000) + 1000;
                            createModel.setModuleIndex(modexInde);
                            for (int i=0;i<createModel.getRows().size();i++){
                                createModel.getRows().get(i).setRowId(String.valueOf(modexInde+1+i));
                            }
                            mPresenter.mCaseBean.getModules().add(createModel);
                            createModels(createModel);
                        }else {
                            ToastUtil.show("暂时不可用");
                        }
                    }
                });
                mView.findViewById(R.id.save_delete).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        LinearLayout layout1 = (LinearLayout) layout.getParent();
                        layout1.removeAllViews();
                        mLayout.remove(layout1);
                        mPresenter.mCaseBean.getModules().remove(createModel);
                    }
                });
            }


            custom.setOnCheckListener(new SpinnerCustom.OnCheckFuOnClick() {
                @Override
                public void onCheckedListener(CheckBoxBean bean, String modeIndex,String mLastModelIndex) {

                    if (row.getIsConHide() == 1) { //有控制隐藏
                        if (row.getConHideType().equals("2")){ //控制模块
                            //显示模块
                            if (mLayout != null&&mLayout.size()>0){
                                for (View view : mLayout){
                                    if (view != null){
                                        if (view.getTag() != null){
                                            if (view.getTag().toString().equals(modeIndex)) {
                                                view.setVisibility(View.VISIBLE);
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }else if (row.getConHideType().equals("1")){
                            //控制当前行
                            String[] strs = new String[0];
                            if (modeIndex!=null){
                                strs = modeIndex.split(",");
                            }

                            String[] laststrs = new String[0];
                            try {
                                laststrs = mLastModelIndex.split(",");
                            }catch (NullPointerException e){
                                e.printStackTrace();
                            }
                            for (String last : laststrs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(last)) {
                                                    view.setVisibility(View.GONE);
//                                                    mPresenter.showHindViewClearData(view);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            for (String s : strs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(s)) {
                                                    view.setVisibility(View.VISIBLE);
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                        }else {

                        }
                    }
                    List<DropBean> list = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());

                    for (DropBean dropBean : list){
                        if (dropBean.getRank().equals("02200002")){
                            CaseBean.ModulesBean.RowsBean mRowBean = modulesBean.getRows().get(Integer.valueOf(dropBean.getValue()));

                            Map<String,String> parmes = new HashMap<>();
                            parmes.put("dropValue",mRowBean.getSelectFieldValue());
                            parmes.put("dropLabel",mRowBean.getSelectFieldLabel());
                            parmes.put("dropTable",mRowBean.getSelectTableValue());
                            parmes.put("dropConditionFormula",mRowBean.getDropFunction());
                            List<DropBean> dropList = new Gson().fromJson(mRowBean.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
                            for (DropBean dropBean1 : dropList){
                                if (dropBean1.getDropField().equals(dropBean.getDropField())) {
                                    if (dropBean1.getRank().equals("02200001")) {
                                        dropBean1.setValue(custom.getCurrentValue());
                                        parmes.put("dropConditionFormula",mRowBean.getDropFunction());
                                        parmes.put("dropConditionJson",new Gson().toJson(dropList));
                                        List<DropBean> dropLists = new Gson().fromJson(mRowBean.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
                                        mPresenter.getFieldValue(parmes,modulesBean,dropLists,mRowBean,mLayout);
                                    }
                                }
                            }

                        }
                    }
                }

                @Override
                public void onUnCheckListener(CheckBoxBean bean, String modeIndex) {
                    if (row.getIsConHide() == 1) { //有控制隐藏
                        if (row.getConHideType().equals("2")) { //控制模块
                            //隐藏模块
                            if (mLayout != null&&mLayout.size()>0){
                                for (View view : mLayout) {
                                    if (view != null) {
                                        if (view.getTag() != null) {
                                            if (view.getTag().toString().equals(modeIndex)) {
                                                view.setVisibility(View.GONE);
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }else if (row.getConHideType().equals("1")){
                            //控制当前行
                        }
                    }



                }

                @Override
                public void onRequestList(CheckBoxBean bean, String modeIndex,boolean isFirstCreate) {
                    //获取联动数据
                    //获取联动数据
                    Map<String,String> parmes = new HashMap<>();
                    parmes.put("dropValue",row.getSelectFieldValue());
                    parmes.put("dropLabel",row.getSelectFieldLabel());
                    parmes.put("dropTable",row.getSelectTableValue());
                    parmes.put("dropConditionFormula",row.getDropFunction());
                    List<DropBean> list = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
                    for (DropBean dropBean : list){
                        if (dropBean.getRank().equals("02200002")){
                            //获取模块索引
                            if (mLayout != null&&mLayout.size()>0){
                                for (LinearLayout view : mLayout) {
                                    if (view != null) {
                                        if (view.getTag() != null) {
                                            if (view.getTag().toString().equals(modeIndex)) {
                                                //获取到该模块
                                                List<View> views = getAllChildViews(view);
                                                for (View view1 :views){
                                                    if (view1 instanceof SpinnerCustom){
                                                        SpinnerCustom custom1 = (SpinnerCustom) view1;
                                                        if (custom1.getRowIndex().equals(dropBean.getValue())){
                                                            dropBean.setValue(custom1.getCurrentValue());
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
//                    parmes.put("dropConditionFormula",row.getDropFunction());
//                    parmes.put("dropConditionJson",new Gson().toJson(list));
//                    mPresenter.getFieldValue(parmes,custom,isFirstCreate);
//                    mPresenter.getFieldValue(parmes,custom,isFirstCreate);
//                    mPresenter.getFieldValue(parmes,modulesBean,list,row,mLayout);
                }
            });
            layout.addView(custom);
            if (row.getIsHide()==1){
                custom.setVisibility(View.GONE);
            }
            if (row.getIsDefault()==1){
                //获取联动数据
                if (type.equals("4")&&mCaseAdvanceBean!=null){

                }else {
                    Map<String,String> parmes = new HashMap<>();
                    parmes.put("dropValue",row.getSelectFieldValue());
                    parmes.put("dropLabel",row.getSelectFieldLabel());
                    parmes.put("dropTable",row.getSelectTableValue());
                    parmes.put("dropConditionFormula",row.getDropFunction());
                    List<DropBean> list = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
//                for (DropBean dropBean : list){
//                    if (dropBean.getRank().equals("02200001")){
//                        //获取模块索引
//                        if (mLayout != null&&mLayout.size()>0){
//                            for (LinearLayout view : mLayout) {
//                                if (view != null) {
//                                    if (view.getTag() != null) {
//                                        if (view.getTag().toString().equals(mIndex)) {
//                                            //获取到该模块
//                                            dropBean.setValue(row.getDefaultValue());
//                                        }
//                                    }
//                                }
//                            }
//                        }
//                    }
//                }
                    parmes.put("dropConditionFormula",row.getDropFunction());
                    parmes.put("dropConditionJson",new Gson().toJson(list));
                    mPresenter.getFieldValue(parmes,custom,true);
                }
            }else {
                boolean isFlag = true;
                List<DropBean> listDrop = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
                for (DropBean dropBean : listDrop){
                    if (dropBean.getRank().equals("02200001")){
                        if (dropBean.getValue().equals("0234")){
                            isFlag = false;
                            if (type.equals("4")&&mCaseAdvanceBean!=null){

                            }else {
                                Map<String, String> parmes = new HashMap<>();
                                parmes.put("dropValue", row.getSelectFieldValue());
                                parmes.put("dropLabel", row.getSelectFieldLabel());
                                parmes.put("dropTable", row.getSelectTableValue());
                                parmes.put("dropConditionFormula", row.getDropFunction());
                                parmes.put("dropConditionFormula", row.getDropFunction());
                                List<DropBean> dropLists = new Gson().fromJson(row.getDropJsonArr(), new TypeToken<List<DropBean>>() {
                                }.getType());
                                parmes.put("dropConditionJson", new Gson().toJson(dropLists));
                                mPresenter.getFieldValue(parmes, custom, true, modulesBean, row, mLayout);
                            }
                        }
                    }
                }
                if (isFlag){
                    if (type.equals("4")){
                        if (mCaseAdvanceBean!=null){
                            if (row.getFieldSave().equals("case_type")){

                            }else if (row.getFieldSave().equals("unlawful_act")){

                            }else if (row.getFieldSave().equals("cause_number")){

                            }else if (row.getFieldSave().equals("applicable_case")){

                            }else if (row.getFieldSave().equals("management_basis")){

                            }else if (row.getFieldSave().equals("legal_basis")){

                            }else {
                                Map<String,String> parmes = new HashMap<>();
                                parmes.put("dropValue",row.getSelectFieldValue());
                                parmes.put("dropLabel",row.getSelectFieldLabel());
                                parmes.put("dropTable",row.getSelectTableValue());
                                parmes.put("dropConditionFormula",row.getDropFunction());
                                parmes.put("dropConditionFormula",row.getDropFunction());
                                List<DropBean> dropLists = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
                                parmes.put("dropConditionJson",new Gson().toJson(dropLists));
                                mPresenter.getFieldValue(parmes,custom,true,modulesBean,row,mLayout);
                            }
                        }else {
                            Map<String,String> parmes = new HashMap<>();
                            parmes.put("dropValue",row.getSelectFieldValue());
                            parmes.put("dropLabel",row.getSelectFieldLabel());
                            parmes.put("dropTable",row.getSelectTableValue());
                            parmes.put("dropConditionFormula",row.getDropFunction());
                            parmes.put("dropConditionFormula",row.getDropFunction());
                            List<DropBean> dropLists = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
                            parmes.put("dropConditionJson",new Gson().toJson(dropLists));
                            mPresenter.getFieldValue(parmes,custom,true,modulesBean,row,mLayout);
                        }
                    }else {
                        Map<String,String> parmes = new HashMap<>();
                        parmes.put("dropValue",row.getSelectFieldValue());
                        parmes.put("dropLabel",row.getSelectFieldLabel());
                        parmes.put("dropTable",row.getSelectTableValue());
                        parmes.put("dropConditionFormula",row.getDropFunction());
                        parmes.put("dropConditionFormula",row.getDropFunction());
                        List<DropBean> dropLists = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
                        parmes.put("dropConditionJson",new Gson().toJson(dropLists));
                        mPresenter.getFieldValue(parmes,custom,true,modulesBean,row,mLayout);
                    }





                }
            }

        }else if (row.getConType().equals("onechoice")){
            List<CheckBoxBean> checkBoxBeans = new Gson().fromJson(row.getFillValueOptions(),new TypeToken<List<CheckBoxBean>>(){}.getType());
            Map<String, String> stringStringMap = null;
            if (row.getConShowIndex() != "{}") {
                stringStringMap = new Gson().fromJson(row.getConShowIndex(), new TypeToken<Map<String, String>>() {
                }.getType());
            }
            //单选框
            SingleCheckCustom custom = new SingleCheckCustom(mContext);
            custom.setTag(row.getRowIndex()+"");

            custom.setmRowIndex(row.getRowIndex()+"");
            custom.setMapKeyValue(stringStringMap);



            custom.setOnCheckListener(new SingleCheckCustom.OnCheckFuOnClick() {
                @Override
                public void onCheckedListener(CheckBoxBean bean,String modeIndex,String lastModeIndex) {
                    if (row.getIsConHide() == 1) { //有控制隐藏
                        if (row.getConHideType().equals("2")) { //控制模块

                            if (mLayout != null&&mLayout.size()>0){
                                for (View view : mLayout){
                                    if (view != null){
                                        if (view.getTag() != null){
                                            if (view.getTag().toString().equals(row.getIsConHide()+"")) {
                                                view.setVisibility(View.GONE);
                                            }
                                        }
                                    }
                                }
                            }
                            if (mLayout != null&&mLayout.size()>0){
                                for (View view : mLayout){
                                    if (view != null){
                                        if (view.getTag() != null){
                                            if (view.getTag().toString().equals(modeIndex)) {
                                                view.setVisibility(View.VISIBLE);
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }else if (row.getConHideType().equals("1")){
                            //控制当前行
                            //控制当前行
                            String[] strs = new String[0];
                            if (modeIndex!=null){
                                strs = modeIndex.split(",");
                            }

                            String[] laststrs = new String[0];
                            try {
                                laststrs = lastModeIndex.split(",");
                            }catch (NullPointerException e) {
                                e.printStackTrace();
                            }
                            for (String last : laststrs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(last)) {
                                                    view.setVisibility(View.GONE);
                                                    mPresenter.showHindViewClearData(view);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            for (String s : strs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(s)) {
                                                    view.setVisibility(View.VISIBLE);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }else {

                        }
                    }


                }

                @Override
                public void onUnCheckListener(CheckBoxBean bean,String modeIndex,String lastModeIndex) {
                    if (row.getIsConHide() == 1) { //有控制隐藏
                        if (row.getConHideType().equals("2")) { //控制模块
                            if (mLayout != null&&mLayout.size()>0){
                                for (View view : mLayout) {
                                    if (view != null) {
                                        if (view.getTag() != null) {
                                            if (view.getTag().toString().equals(modeIndex)) {
                                                view.setVisibility(View.GONE);
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }else if (row.getConHideType().equals("1")){
                            //控制当前行
                            //控制当前行
                            String[] strs = new String[0];
                            if (modeIndex!=null){
                                strs = modeIndex.split(",");
                            }

                            String[] laststrs = new String[0];
                            try {
                                laststrs = lastModeIndex.split(",");
                            }catch (NullPointerException e){
                                e.printStackTrace();
                            }
                            for (String last : laststrs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(last)) {
                                                    view.setVisibility(View.GONE);
                                                    mPresenter.showHindViewClearData(view);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            for (String s : strs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(s)) {
                                                    view.setVisibility(View.VISIBLE);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }else {

                        }
                    }

                }
            });
            if (row.getIsHide()==1){
                custom.setVisibility(View.GONE);
            }
            layout.addView(custom);
            List<DropBean> listDrop = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
            Map<String,String> parmes = new HashMap<>();
            parmes.put("dropValue",row.getSelectFieldValue());
            parmes.put("dropLabel",row.getSelectFieldLabel());
            parmes.put("dropTable",row.getSelectTableValue());
            parmes.put("dropConditionFormula",row.getDropFunction());
            parmes.put("dropConditionFormula",row.getDropFunction());
            parmes.put("dropConditionJson",new Gson().toJson(listDrop));
            mPresenter.getFieldValue(parmes,custom,row.getRowLabel(),row);
        }else if (row.getConType().equals("multipleDrop")){
            List<CheckBoxBean> checkBoxBeans = new Gson().fromJson(row.getFillValueOptions(),new TypeToken<List<CheckBoxBean>>(){}.getType());
            Map<String,String> stringStringMap = null;
            try {
                stringStringMap = new Gson().fromJson(row.getConShowIndex(),new TypeToken<Map<String,String>>(){}.getType());
            }catch (JsonSyntaxException e){
                stringStringMap = new HashMap<>();
            }


            //复选框
            CheckMultipleDropCustom custom = new CheckMultipleDropCustom(mContext);
            custom.setTag(row.getRowIndex()+"");
            custom.createChrid(checkBoxBeans,row.getRowLabel());
            custom.setMapKeyValue(stringStringMap);
            custom.setmRowIndex(row.getRowIndex()+"");
            custom.setOnCheckListener(new CheckMultipleDropCustom.OnCheckFuOnClick() {
                @Override
                public void onCheckedListener(CheckBoxBean bean,String modeIndex,String mLastModelIndex) {
                    if (row.getIsConHide() == 1) { //有控制隐藏
                        if (row.getConHideType().equals("2")){ //控制模块
                            if (mLayout != null && mLayout.size() > 0) {
                                for (View view : mLayout) {
                                    if (view != null) {
                                        if (view.getTag() != null) {
                                            if (view.getTag().toString().equals(modeIndex)) {
                                                view.setVisibility(View.VISIBLE);
                                                return;
                                            }
                                        }
                                    }
                                }
                            }

                        }else if (row.getConHideType().equals("1")){
                            //控制当前行
                            String[] strs = modeIndex.split(",");
                            String[] laststrs = mLastModelIndex.split(",");
                            for (String last : laststrs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(last)) {
                                                    view.setVisibility(View.GONE);
                                                    mPresenter.showHindViewClearData(view);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            for (String s : strs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(s)) {
                                                    view.setVisibility(View.VISIBLE);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }else {

                        }


                    }

                }



                @Override
                public void onUnCheckListener(CheckBoxBean bean,String modeIndex,String mLastModelIndex) {
                    if (row.getIsConHide() == 1) { //有控制隐藏
                        if (row.getConHideType().equals("2")){ //控制模块
                            if (mLayout != null&&mLayout.size()>0){
                                for (View view : mLayout) {
                                    if (view != null) {
                                        if (view.getTag() != null) {
                                            if (view.getTag().toString().equals(modeIndex)) {
                                                view.setVisibility(View.GONE);
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }else if (row.getConHideType().equals("1")){
                            //控制当前行
                            String[] strs = modeIndex.split(",");
                            String[] laststrs = mLastModelIndex.split(",");
                            for (String last : laststrs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(last)) {
                                                    view.setVisibility(View.GONE);
                                                    mPresenter.showHindViewClearData(view);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            for (String s : strs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(s)) {
                                                    view.setVisibility(View.VISIBLE);
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                        }else {

                        }


                    }

                }
            });
            layout.addView(custom);
            if (row.getIsHide()==1){
                custom.setVisibility(View.GONE);
            }
            List<DropBean> listDrop = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
            Map<String,String> parmes = new HashMap<>();
            parmes.put("dropValue",row.getSelectFieldValue());
            parmes.put("dropLabel",row.getSelectFieldLabel());
            parmes.put("dropTable",row.getSelectTableValue());
            parmes.put("dropConditionFormula",row.getDropFunction());
            parmes.put("dropConditionFormula",row.getDropFunction());
            parmes.put("dropConditionJson",new Gson().toJson(listDrop));
            mPresenter.getFieldValue(parmes,custom,row.getRowLabel());
        }else if (row.getConType().equals("morechoice")){

            List<CheckBoxBean> checkBoxBeans = new Gson().fromJson(row.getFillValueOptions(),new TypeToken<List<CheckBoxBean>>(){}.getType());
            Map<String,String> stringStringMap = null;
            try {
                stringStringMap = new Gson().fromJson(row.getConShowIndex(),new TypeToken<Map<String,String>>(){}.getType());
            }catch (JsonSyntaxException e){
                stringStringMap = new HashMap<>();
            }


            //复选框
            CheckBoxCustom custom = new CheckBoxCustom(mContext);
            custom.setTag(row.getRowIndex()+"");
            custom.createChrid(checkBoxBeans,row.getRowLabel());
            custom.setMapKeyValue(stringStringMap);
            custom.setmRowIndex(row.getRowIndex()+"");
            custom.setOnCheckListener(new CheckBoxCustom.OnCheckFuOnClick() {
                @Override
                public void onCheckedListener(CheckBoxBean bean,String modeIndex,String mLastModelIndex) {
                    if (row.getIsConHide() == 1) { //有控制隐藏
                        if (row.getConHideType().equals("2")){ //控制模块
                            if (mLayout != null && mLayout.size() > 0) {
                                for (View view : mLayout) {
                                    if (view != null) {
                                        if (view.getTag() != null) {
                                            if (view.getTag().toString().equals(modeIndex)) {
                                                view.setVisibility(View.VISIBLE);
                                                return;
                                            }
                                        }
                                    }
                                }
                            }

                        }else if (row.getConHideType().equals("1")){
                            //控制当前行
                            String[] strs = modeIndex.split(",");
                            String[] laststrs = mLastModelIndex.split(",");
                            for (String last : laststrs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(last)) {
                                                    view.setVisibility(View.GONE);
                                                    mPresenter.showHindViewClearData(view);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            for (String s : strs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(s)) {
                                                    view.setVisibility(View.VISIBLE);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }else {

                        }


                    }

                }



                @Override
                public void onUnCheckListener(CheckBoxBean bean,String modeIndex,String mLastModelIndex) {
                    if (row.getIsConHide() == 1) { //有控制隐藏
                        if (row.getConHideType().equals("2")){ //控制模块
                            if (mLayout != null&&mLayout.size()>0){
                                for (View view : mLayout) {
                                    if (view != null) {
                                        if (view.getTag() != null) {
                                            if (view.getTag().toString().equals(modeIndex)) {
                                                view.setVisibility(View.GONE);
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }else if (row.getConHideType().equals("1")){
                            //控制当前行
                            String[] strs = modeIndex.split(",");
                            String[] laststrs = mLastModelIndex.split(",");
                            for (String last : laststrs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(last)) {
                                                    view.setVisibility(View.GONE);
                                                    mPresenter.showHindViewClearData(view);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            for (String s : strs){
                                if (layout != null&&layout.getChildCount()>0){
                                    for (View view : getAllChildViews(layout)){
                                        if (view != null){
                                            if (view.getTag() != null){
                                                if (view.getTag().toString().equals(s)) {
                                                    view.setVisibility(View.VISIBLE);
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                        }else {

                        }


                    }

                }
            });
            layout.addView(custom);
            if (row.getIsHide()==1){
                custom.setVisibility(View.GONE);
            }
            List<DropBean> listDrop = new Gson().fromJson(row.getDropJsonArr(),new TypeToken<List<DropBean>>(){}.getType());
            Map<String,String> parmes = new HashMap<>();
            parmes.put("dropValue",row.getSelectFieldValue());
            parmes.put("dropLabel",row.getSelectFieldLabel());
            parmes.put("dropTable",row.getSelectTableValue());
            parmes.put("dropConditionFormula",row.getDropFunction());
            parmes.put("dropConditionFormula",row.getDropFunction());
            parmes.put("dropConditionJson",new Gson().toJson(listDrop));
            mPresenter.getFieldValue(parmes,custom,row.getRowLabel());
        }else if (row.getConType().equals("up")){
            final CaseBean.ModulesBean createModel = (CaseBean.ModulesBean) modulesBean.clone();
            //图片上传
            ImagePickView custom = new ImagePickView(mContext,null);
            custom.setTag(row.getRowIndex()+"");
            custom.setmRowIndex(row.getRowIndex()+"");
            layout.addView(custom);

        }else if (row.getConType().equals("upfile")){
            //文件上传

            final CaseBean.ModulesBean createModel = (CaseBean.ModulesBean) modulesBean.clone();
            //图片上传
            ImagePickView custom = new ImagePickView(mContext,null);
            custom.setTag(row.getRowIndex()+"");
            custom.setmRowIndex(row.getRowIndex()+"");
            layout.addView(custom);

//            DateCustom custom = new DateCustom(mContext);
//            custom.setTag(row.getRowIndex()+"");
//            custom.setmTvName(row.getRowLabel());
//            custom.setmRowIndex(row.getRowIndex()+"");
//            custom.setmTvDate("文件上传");
//            layout.addView(custom);
//            if (row.getIsHide()==1){
//                custom.setVisibility(View.GONE);
//            }
        }
    }










    @Override
    public void onBackPressedSupport() {
        mWaringDialog.show();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mPresenter.release();
    }
}
